﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MessageForm : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        (Master.FindControl("PageSubtitleLabel") as Label).Text = "";
        
        if( !Page.IsCallback )
        {
            string msg = Session["MessageForm.Message"] as string;
            if (string.IsNullOrEmpty(msg)) msg = "Click OK to continue";

            string redirect = Session["MessageForm.Redirect"] as string;
            if (string.IsNullOrEmpty(redirect)) redirect = "~/default.aspx";

            lblMessage.Text = msg;
            btnDismiss.CommandArgument = redirect;
        }
    }

    protected void btnDismiss_Click(object sender, EventArgs e)
    {
        Response.Redirect(btnDismiss.CommandArgument);
    }
}
